# -*- coding: utf-8 -*-


import requests

url = 'https://www.zhihu.com/'

head = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
}

res = requests.get(url, headers=head, allow_redirects=False)

with open('zhihu.html', 'w', encoding='utf-8')as f:
    f.write(res.text)